//
//  HX_MyPage.m
//  07 - UITabBarController
//
//  Created by 韩旭 on 16/7/22.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "HX_MyPage.h"
#import "ViewController.h"

#define WIDETH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
#define COLORAUTO [UIColor colorWithRed:(arc4random()%256/255.0) green:(arc4random()%256/255.0) blue:(arc4random()%256/255.0) alpha:1.0]

#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height

@interface HX_MyPage ()
@property (nonatomic, strong) UIButton *btn;
@property (nonatomic, strong) UIView *viewBack;
@property (nonatomic, strong) UILabel *lableName;

@end

@implementation HX_MyPage

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.viewBack = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight * 0.25)];
    _viewBack.backgroundColor = [UIColor colorWithRed:0.00 green:0.74 blue:0.55 alpha:1.00];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
    [_btn setImage:[UIImage imageNamed:@"touxiang.jpg"] forState:UIControlStateNormal];
    _btn.layer.masksToBounds = YES;
    _btn.layer.cornerRadius = 25;
    _btn.center = CGPointMake(kWidth / 2, 60);
    _btn.backgroundColor = [UIColor clearColor];
    
    _lableName = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
    _lableName.center = CGPointMake(kWidth / 2, 120);
    _lableName.backgroundColor = [UIColor clearColor];
    _lableName.text = @"注册/登录";
    _lableName.textAlignment = 1;
    [self.viewBack addSubview:_lableName];
    
    [_btn addTarget:self action:@selector(toViewController:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:_viewBack];
    [self.viewBack addSubview:_btn];
}
- (void)toViewController:(UIButton *)btn {
    ViewController *view = [[ViewController alloc] init];
    [self.navigationController pushViewController:view animated:YES];
//    [self presentViewController:[[ViewController alloc] init] animated:YES completion:nil];
}

@end
